import Vue from 'vue'
import App from './App'

import { myRequest } from './util/api.js'
Vue.prototype.$myRequest = myRequest

// 定义一个全局的时间过滤器，创建时间对象，获取年月日进行拼接，toString()转化为字符串，用padStart()不足2为用0补充
Vue.filter('formatDate', (date) => {
		const nDate = new Date(date)
		const year = nDate.getFullYear()
		const month = nDate.getMonth().toString().padStart(2,0)
		const day = nDate.getDay().toString().padStart(2,0)
		return year+'-'+month+'-'+day
})

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
    ...App
})
app.$mount()
